#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
@Author   : long.hai
@Contact  : 1982964634@qq.com
"""
from _base.base import BasePage
from _step.judge import Judge


class Logic(object):

    def __init__(self, base_page):
        self.base_page: BasePage = base_page

    async def multiple_if_control(self, conditions):
        """
        多个控制条件
        :param conditions: 多个控制条件
        :return:
        """
        for item in conditions:
            ctrl_method = item["type"]
            res = await getattr(Judge, ctrl_method)(self.base_page, **item)
            if not res:
                return False
        return True
